package com.rd.student.ruanjian.class4.baiyunyao.DAY0728;

import java.io.File;
class  listall<result> {
public static void listAll(File file){

        if(!file.exists())return;

        File[]files=file.listFiles();
        if(files==null||files.length==0)return;
        for(File tmpFile:files){
        if(tmpFile.isFile()){
        System.out.println(file.getName()+" -> "+tmpFile.getName());
        continue;
        }
        if(tmpFile.isDirectory()){
        System.out.println(file.getName()+" - "+tmpFile.getName());
        listAll(tmpFile);
                File target=new File("target");
                System.out.println(target.getAbsolutePath());


                Boolean result=target.delete();
                if(result){
                        System.out.println("文件夹删除成功");
                }else{
                        System.out.println("文件夹删除失败");
        }
        }
        }


        }
        }

